const Router = require('Koa-router')
const {reguster,logo,changePassword}=require("../controller/user.controller")
const {auth}=require("../middleware/auth.middleware")
const router = new Router({prefix: "/user"})
const {validator,verfyUser,crpytPassword,verfyLogin}=require("../middleware/user.middleware")
// 注册
router.post('/register',validator,verfyUser,crpytPassword,reguster)
// 登录
router.post('/login',validator,verfyLogin,logo)
// 密码修改
router.patch('/',auth,crpytPassword,changePassword,(ctx,next)=>{
    ctx.body="密码修改成功"
})
module.exports = router